﻿<Window x:Class="ApophysisCS.EditorWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:ApophysisCS"
        Title="Editor" Height="772" Width="800" SnapsToDevicePixels="True" Icon="{StaticResource EditorIcon}">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <ToolBarTray Grid.Row="0">
            <ToolBar HorizontalAlignment="Left" VerticalAlignment="Top" Band="1" BandIndex="1">
                <Button ToolTip="New flame">
                    <Image Source="{StaticResource EditorButtonBitmap1}"/>
                </Button>
                <Button ToolTip="New transform">
                    <Image Source="{StaticResource EditorButtonBitmap2}"/>
                </Button>
                <Button ToolTip="Duplicate transform">
                    <Image Source="{StaticResource EditorButtonBitmap3}"/>
                </Button>
                <Button ToolTip="Remove transform">
                    <Image Source="{StaticResource EditorButtonBitmap4}"/>
                </Button>
                <Separator/>
                <Button ToolTip="Undo">
                    <Image Source="{StaticResource EditorButtonBitmap5}"/>
                </Button>
                <Button ToolTip="Redo">
                    <Image Source="{StaticResource EditorButtonBitmap6}"/>
                </Button>
                <Separator/>
                <Button ToolTip="Copy transform">
                    <Image Source="{StaticResource EditorButtonBitmap27}"/>
                </Button>
                <Button ToolTip="Paste transform">
                    <Image Source="{StaticResource EditorButtonBitmap28}"/>
                </Button>
                <Separator/>
                <ToggleButton ToolTip="Selection mode" IsChecked="True">
                    <Image Source="{StaticResource EditorButtonBitmap7}"/>
                </ToggleButton>
                <RadioButton ToolTip="Movement mode" IsChecked="True">
                    <Image Source="{StaticResource EditorButtonBitmap8}"/>
                </RadioButton>
                <RadioButton ToolTip="Rotation mode">
                    <Image Source="{StaticResource EditorButtonBitmap9}"/>
                </RadioButton>
                <RadioButton ToolTip="Scale mode">
                    <Image Source="{StaticResource EditorButtonBitmap10}"/>
                </RadioButton>
                <ToggleButton ToolTip="Toggle world pivot">
                    <Image Source="{StaticResource EditorButtonBitmap16}"/>
                </ToggleButton>
                <Separator/>
                <Button ToolTip="Rotate 90° counter-clockwise">
                    <Image Source="{StaticResource EditorButtonBitmap18}"/>
                </Button>
                <Button ToolTip="Rotate 90° clockwise">
                    <Image Source="{StaticResource EditorButtonBitmap19}"/>
                </Button>
                <Button ToolTip="Flip horizontal">
                    <Image Source="{StaticResource EditorButtonBitmap11}"/>
                </Button>
                <Button ToolTip="Flip vertical">
                    <Image Source="{StaticResource EditorButtonBitmap12}"/>
                </Button>
                <Separator/>
                <ToggleButton ToolTip="Show variation preview">
                    <Image Source="{StaticResource EditorButtonBitmap15}"/>
                </ToggleButton>
                <Separator/>
                <ToggleButton ToolTip="Enable/edit post-transform">
                    <Image Source="{StaticResource EditorButtonBitmap30}"/>
                </ToggleButton>
                <ToggleButton ToolTip="Enable final transform">
                    <Image Source="{StaticResource EditorButtonBitmap25}"/>
                </ToggleButton>
                <Separator/>
                <Button ToolTip="Add linked transform">
                    <Image Source="{StaticResource EditorButtonBitmap32}"/>
                </Button>
            </ToolBar>
        </ToolBarTray>

        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="300" MinWidth="220"/>
            </Grid.ColumnDefinitions>

            <Canvas Grid.Column="0"/>
            <GridSplitter Grid.Column="1" Width="4" HorizontalAlignment="Stretch"/>
            <Grid Grid.Column="2">
                <Grid.RowDefinitions>
                    <RowDefinition Height="220" MinHeight="220"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>

                <Canvas Grid.Row="0"/>
                <GridSplitter Grid.Row="1" Height="4" HorizontalAlignment="Stretch"/>
                <Grid Grid.Row="2" Height="Auto">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>

                    <Grid Grid.Row="0">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="120"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>

                        <Border Grid.Row="0" Grid.Column="0" Margin="0" Style="{StaticResource TableGridBorder}">
                            <Label Content="Transform:" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold" FontSize="11" Margin="0,-2"/>
                        </Border>
                        <Border Grid.Row="0" Grid.Column="1" Margin="0" Style="{StaticResource TableGridBorder}">
                            <ComboBox BorderThickness="0" SelectedIndex="0" IsEditable="True" IsReadOnly="True">
                                <ComboBoxItem Content="1"/>
                                <ComboBoxItem Content="2"/>
                                <ComboBoxItem Content="3"/>
                            </ComboBox>
                        </Border>
                        <Border Grid.Row="1" Grid.Column="0" Margin="0" Style="{StaticResource TableGridBorder}">
                            <Label Content="Name:" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="11" Margin="0,-2"/>
                        </Border>
                        <Border Grid.Row="1" Grid.Column="1" Margin="0" Style="{StaticResource TableGridBorder}">
                            <TextBox/>
                        </Border>
                        <Border Grid.Row="2" Grid.Column="0" Margin="0" Style="{StaticResource TableGridBorder}">
                            <Label Content="Weight:" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="11" ToolTip="Click and drag to change value" Margin="0,-2"/>
                        </Border>
                        <Border Grid.Row="2" Grid.Column="1" Margin="0" Style="{StaticResource TableGridBorder}">
                            <TextBox/>
                        </Border>
                    </Grid>

                    <TabControl Grid.Row="1" SelectedIndex="0">
                        <TabItem Header="Variations">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>

                                <Grid Grid.Row="0">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>

                                    <TextBlock Grid.Column="0" Text="Search:"/>
                                    <TextBox Grid.Column="1" Margin="4,0"/>
                                    <Button Grid.Column="2" Content="Χ" Width="20" Height="20" FontFamily="Consolas" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="14" BorderThickness="0" Padding="0" Margin="0"/>
                                </Grid>
                                <DataGrid Grid.Row="1"/>
                                <CheckBox Grid.Row="2"  Content="Hide unused variations" />
                                <Button Grid.Row="3" Content="Clear"/>
                            </Grid>
                        </TabItem>
                        <TabItem Header="Variables">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>

                                <DataGrid Grid.Row="0"/>
                                <CheckBox Grid.Row="1" Content="Show all variables"/>
                            </Grid>
                        </TabItem>
                        <TabItem Header="Xaos">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>

                                <DataGrid Grid.Row="0"/>
                                <RadioButton Grid.Row="1" Content="View as &quot;to&quot;" IsChecked="True"/>
                                <RadioButton Grid.Row="2" Content="View as &quot;from&quot;"/>
                            </Grid>
                        </TabItem>
                        <TabItem Header="Triangle">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>

                                <GroupBox Grid.Row="0" Width="200" Margin="0,0,0,8">
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto"/>
                                        </Grid.RowDefinitions>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="14"/>
                                            <ColumnDefinition Width="*"/>
                                            <ColumnDefinition Width="*"/>
                                        </Grid.ColumnDefinitions>

                                        <TextBlock Grid.Row="0" Grid.Column="0" Text="X:" Margin="0,6,0,1" VerticalAlignment="Center" FontSize="11"/>
                                        <TextBox Grid.Row="0" Grid.Column="1" Margin="2,6,2,1" FontSize="10"/>
                                        <TextBox Grid.Row="0" Grid.Column="2" Margin="2,6,2,1" FontSize="10"/>
                                        <TextBlock Grid.Row="1" Grid.Column="0" Text="Y:" Margin="0,1" VerticalAlignment="Center" FontSize="11"/>
                                        <TextBox Grid.Row="1" Grid.Column="1" Margin="2,1" FontSize="10"/>
                                        <TextBox Grid.Row="1" Grid.Column="2" Margin="2,1" FontSize="10"/>
                                        <TextBlock Grid.Row="2" Grid.Column="0" Text="O:" Margin="0,1" VerticalAlignment="Center" FontSize="11"/>
                                        <TextBox Grid.Row="2" Grid.Column="1" Margin="2,1" FontSize="10"/>
                                        <TextBox Grid.Row="2" Grid.Column="2" Margin="2,1" FontSize="10"/>
                                    </Grid>
                                </GroupBox>
                                <GroupBox Grid.Row="1" Margin="0,0,0,8" HorizontalAlignment="Center">
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto"/>
                                        </Grid.RowDefinitions>

                                        <Grid Grid.Row="0" Height="22" Margin="0,6,0,0" HorizontalAlignment="Center">
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="60"/>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="Auto"/>
                                            </Grid.ColumnDefinitions>

                                            <Button Grid.Column="0" ToolTip="Rotate 90° counter-clockwise" Margin="1,0">
                                                <Image Source="{StaticResource EditorButtonBitmap90CCW}"/>
                                            </Button>
                                            <Button Grid.Column="1" ToolTip="Rotate triangle counter-clockwise" Margin="1,0">
                                                <Image Source="{StaticResource EditorButtonBitmapCCW}"/>
                                            </Button>
                                            <ComboBox Grid.Column="2" SelectedIndex="1" IsEditable="True" FontSize="10" Margin="1,0">
                                                <ComboBoxItem Content="5"/>
                                                <ComboBoxItem Content="15"/>
                                                <ComboBoxItem Content="30"/>
                                                <ComboBoxItem Content="45"/>
                                                <ComboBoxItem Content="60"/>
                                                <ComboBoxItem Content="90"/>
                                                <ComboBoxItem Content="120"/>
                                                <ComboBoxItem Content="180"/>
                                            </ComboBox>
                                            <Button Grid.Column="3" ToolTip="Rotate triangle clockwise" Margin="1,0">
                                                <Image Source="{StaticResource EditorButtonBitmapCW}"/>
                                            </Button>
                                            <Button Grid.Column="4" ToolTip="Rotate 90° clockwise" Margin="1,0">
                                                <Image Source="{StaticResource EditorButtonBitmap90CW}"/>
                                            </Button>
                                        </Grid>
                                        <Grid Grid.Row="1" Height="22" Margin="0,4,0,0" HorizontalAlignment="Center">
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="60"/>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="Auto"/>
                                            </Grid.ColumnDefinitions>

                                            <Button Grid.Column="0" ToolTip="Move triangle up" Margin="1,0">
                                                <Image Source="{StaticResource EditorButtonBitmapUp}"/>
                                            </Button>
                                            <Button Grid.Column="1" ToolTip="Move triangle down" Margin="1,0">
                                                <Image Source="{StaticResource EditorButtonBitmapDown}"/>
                                            </Button>
                                            <ComboBox Grid.Column="2" SelectedIndex="3" IsEditable="True" FontSize="10" Margin="1,0">
                                                <ComboBoxItem Content="1"/>
                                                <ComboBoxItem Content="0.5"/>
                                                <ComboBoxItem Content="0.25"/>
                                                <ComboBoxItem Content="0.1"/>
                                                <ComboBoxItem Content="0.05"/>
                                                <ComboBoxItem Content="0.025"/>
                                                <ComboBoxItem Content="0.01"/>
                                            </ComboBox>
                                            <Button Grid.Column="3" ToolTip="Move triangle left" Margin="1,0">
                                                <Image Source="{StaticResource EditorButtonBitmapLeft}"/>
                                            </Button>
                                            <Button Grid.Column="4" ToolTip="Move triangle right" Margin="1,0">
                                                <Image Source="{StaticResource EditorButtonBitmapRight}"/>
                                            </Button>
                                        </Grid>
                                        <Grid Grid.Row="2" Height="22" Margin="0,4,0,0" HorizontalAlignment="Center">
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="60"/>
                                                <ColumnDefinition Width="Auto"/>
                                            </Grid.ColumnDefinitions>

                                            <Button Grid.Column="0" ToolTip="Scale triangle down" Margin="1,0">
                                                <Image Source="{StaticResource EditorButtonBitmapScaleDown}"/>
                                            </Button>
                                            <ComboBox Grid.Column="1" SelectedIndex="1" IsEditable="True" FontSize="10" Margin="1,0">
                                                <ComboBoxItem Content="110"/>
                                                <ComboBoxItem Content="125"/>
                                                <ComboBoxItem Content="150"/>
                                                <ComboBoxItem Content="175"/>
                                                <ComboBoxItem Content="200"/>
                                            </ComboBox>
                                            <Button Grid.Column="2" ToolTip="Scale triangle up" Margin="1,0">
                                                <Image Source="{StaticResource EditorButtonBitmapScaleUp}"/>
                                            </Button>
                                        </Grid>
                                    </Grid>
                                </GroupBox>
                                <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,0,0,2">
                                    <Button ToolTip="Copy" Margin="1,0">
                                        <Image Source="{StaticResource EditorButtonBitmap27}"/>
                                    </Button>
                                    <Button ToolTip="Paste" Margin="1,0">
                                        <Image Source="{StaticResource EditorButtonBitmap28}"/>
                                    </Button>
                                    <ToggleButton ToolTip="Toggle extended edit mode" IsChecked="True" Margin="1,0">
                                        <Image Source="{StaticResource EditorButtonBitmap26}"/>
                                    </ToggleButton>
                                    <ToggleButton ToolTip="Lock transform axes" IsChecked="True" Margin="1,0">
                                        <Image Source="{StaticResource EditorButtonBitmap17}"/>
                                    </ToggleButton>
                                    <ToggleButton ToolTip="Auto-balance weights" Margin="1,0">
                                        <Image Source="{StaticResource EditorButtonBitmap29}"/>
                                    </ToggleButton>
                                    <ToggleButton ToolTip="Enable/edit post-transform" Margin="1,0">
                                        <Image Source="{StaticResource EditorButtonBitmap30}"/>
                                    </ToggleButton>
                                </StackPanel>
                                <GroupBox Grid.Row="3" Width="200">
                                    <GroupBox.Header>
                                        <Label>Pivot</Label>
                                    </GroupBox.Header>
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto"/>
                                        </Grid.RowDefinitions>

                                        <Grid Grid.Row="0">
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="*"/>
                                            </Grid.ColumnDefinitions>

                                            <TextBox Grid.Column="0" Text="0" ToolTip="Pivot point coordinates in chosen coordinate system" FontSize="10" Margin="0,0,2,4"/>
                                            <TextBox Grid.Column="1" Text="0" ToolTip="Pivot point coordinates in chosen coordinate system" FontSize="10" Margin="2,0,0,4"/>
                                        </Grid>
                                        <Grid Grid.Row="1">
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="Auto"/>
                                            </Grid.ColumnDefinitions>

                                            <Button Grid.Column="0" Content="R" ToolTip="Reset pivot point" Width="20" Height="20" FontFamily="Consolas" FontSize="14" BorderThickness="0" Padding="0" Margin="0"/>
                                            <Button Grid.Column="1" Content="Local" ToolTip="Toggle world pivot" BorderThickness="0" Padding="0" Margin="4,0"/>
                                            <Button Grid.Column="2" Content="P" ToolTip="Pick pivot point" Width="20" Height="20" FontFamily="Consolas" FontSize="14" BorderThickness="0" Padding="0" Margin="0"/>
                                        </Grid>
                                    </Grid>
                                </GroupBox>
                            </Grid>
                        </TabItem>
                        <TabItem Header="Transform">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>

                                <GroupBox Grid.Row="0" Width="200" Margin="0,0,0,2">
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="3"/>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="3"/>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="3"/>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="3"/>
                                            <RowDefinition Height="Auto"/>
                                        </Grid.RowDefinitions>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto"/>
                                            <ColumnDefinition Width="*"/>
                                            <ColumnDefinition Width="*"/>
                                        </Grid.ColumnDefinitions>

                                        <Button Grid.Row="1" Grid.Column="0" Content="X" ToolTip="Reset Vector X" Margin="0,0,3,0" Width="22" Height="20" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="11" FontWeight="Bold"/>
                                        <TextBox Grid.Row="1" Grid.Column="1" Margin="2,0" FontSize="10" VerticalAlignment="Center"/>
                                        <TextBox Grid.Row="1" Grid.Column="2" Margin="2,0" FontSize="10" VerticalAlignment="Center"/>
                                        <Button Grid.Row="3" Grid.Column="0" Content="Y" ToolTip="Reset Vector Y" Margin="0,0,3,0" Width="22" Height="20" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="11" FontWeight="Bold"/>
                                        <TextBox Grid.Row="3" Grid.Column="1" Margin="2,0" FontSize="10" VerticalAlignment="Center"/>
                                        <TextBox Grid.Row="3" Grid.Column="2" Margin="2,0" FontSize="10" VerticalAlignment="Center"/>
                                        <Button Grid.Row="5" Grid.Column="0" Content="O" ToolTip="Reset Vector O" Margin="0,0,3,0" Width="22" Height="20" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="11" FontWeight="Bold"/>
                                        <TextBox Grid.Row="5" Grid.Column="1" Margin="2,0" FontSize="10" VerticalAlignment="Center"/>
                                        <TextBox Grid.Row="5" Grid.Column="2" Margin="2,0" FontSize="10" VerticalAlignment="Center"/>
                                        <Button Grid.Row="7" Grid.ColumnSpan="3" Content="Reset transform" ToolTip="Reset all vectors to default position" Height="20" VerticalAlignment="Center" FontSize="11" FontWeight="Bold"/>
                                    </Grid>
                                </GroupBox>
                                <GroupBox Grid.Row="1" Width="200" Margin="0,0,0,2">
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="3"/>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="3"/>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="3"/>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="3"/>
                                            <RowDefinition Height="Auto"/>
                                        </Grid.RowDefinitions>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto"/>
                                            <ColumnDefinition Width="*"/>
                                            <ColumnDefinition Width="*"/>
                                        </Grid.ColumnDefinitions>

                                        <Button Grid.Row="1" Grid.Column="0" Content="X" ToolTip="Reset Vector X" Margin="0,0,3,0" Width="22" Height="20" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="11"/>
                                        <TextBox Grid.Row="1" Grid.Column="1" Margin="2,0" FontSize="10" VerticalAlignment="Center"/>
                                        <TextBox Grid.Row="1" Grid.Column="2" Margin="2,0" FontSize="10" VerticalAlignment="Center"/>
                                        <Button Grid.Row="3" Grid.Column="0" Content="Y" ToolTip="Reset Vector Y" Margin="0,0,3,0" Width="22" Height="20" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="11"/>
                                        <TextBox Grid.Row="3" Grid.Column="1" Margin="2,0" FontSize="10" VerticalAlignment="Center"/>
                                        <TextBox Grid.Row="3" Grid.Column="2" Margin="2,0" FontSize="10" VerticalAlignment="Center"/>
                                        <Button Grid.Row="5" Grid.Column="0" Content="O" ToolTip="Reset Vector O" Margin="0,0,3,0" Width="22" Height="20" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="11"/>
                                        <TextBox Grid.Row="5" Grid.Column="1" Margin="2,0" FontSize="10" VerticalAlignment="Center"/>
                                        <TextBox Grid.Row="5" Grid.Column="2" Margin="2,0" FontSize="10" VerticalAlignment="Center"/>
                                        <Button Grid.Row="7" Grid.ColumnSpan="3" Content="Reset transform" ToolTip="Reset all post-transform vectors to default position" Height="20" VerticalAlignment="Center" FontSize="11"/>
                                    </Grid>
                                </GroupBox>
                                <GroupBox Grid.Row="2" Width="200" Margin="0,0,0,2">
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="3"/>
                                            <RowDefinition Height="20"/>
                                            <RowDefinition Height="3"/>
                                        </Grid.RowDefinitions>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="*"/>
                                            <ColumnDefinition Width="2"/>
                                            <ColumnDefinition Width="*"/>
                                        </Grid.ColumnDefinitions>

                                        <RadioButton Grid.Row="1" Grid.Column="0" Style="{StaticResource {x:Type ToggleButton}}" Content="Rectangular" ToolTip="Show vectors in rectangular (cartesian) coordinates" IsChecked="True" HorizontalAlignment="Right" VerticalAlignment="Center" BorderThickness="0" Width="85" FontSize="10" VerticalContentAlignment="Center"/>
                                        <RadioButton Grid.Row="1" Grid.Column="2" Style="{StaticResource {x:Type ToggleButton}}" Content="Polar (deg)" ToolTip="Show vectors in polar coordinates" HorizontalAlignment="Left" VerticalAlignment="Center" BorderThickness="0" Width="85" FontSize="10" VerticalContentAlignment="Center"/>
                                    </Grid>
                                </GroupBox>
                                <Grid Grid.Row="3">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="8"/>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>

                                    <CheckBox Grid.Column="1" Content="Auto-calculate pre__zscale"/>
                                </Grid>
                            </Grid>
                        </TabItem>
                        <TabItem Header="Colors">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="4"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>

                                <GroupBox Grid.Row="0">
                                    <GroupBox.Header>
                                        <Label>Transform color</Label>
                                    </GroupBox.Header>

                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="4"/>
                                            <RowDefinition Height="12"/>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="6"/>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="6"/>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto"/>
                                        </Grid.RowDefinitions>

                                        <Grid Grid.Row="1">
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="80"/>
                                                <ColumnDefinition Width="1"/>
                                                <ColumnDefinition Width="*"/>
                                            </Grid.ColumnDefinitions>

                                            <Border Grid.Column="0" Padding="0,1,1,1">
                                                <Canvas Background="Black"/>
                                            </Border>
                                            <TextBox Grid.Column="2" FontSize="11"/>
                                        </Grid>
                                        <Canvas Grid.Row="3" Background="Gray"/>
                                        <ScrollBar Grid.Row="4" Orientation="Horizontal" RenderTransformOrigin="0.5,0.5" LargeChange="0.01" SmallChange="0.001">
                                            <ScrollBar.RenderTransform>
                                                <TransformGroup>
                                                    <ScaleTransform ScaleY="0.7"/>
                                                    <SkewTransform/>
                                                    <RotateTransform/>
                                                    <TranslateTransform Y="-3"/>
                                                </TransformGroup>
                                            </ScrollBar.RenderTransform>
                                        </ScrollBar>
                                        <Grid Grid.Row="6">
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="6"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="6"/>
                                                <RowDefinition Height="Auto"/>
                                            </Grid.RowDefinitions>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="70"/>
                                                <ColumnDefinition Width="6"/>
                                                <ColumnDefinition Width="*"/>
                                            </Grid.ColumnDefinitions>
                                            
                                            <TextBlock Grid.Row="0" Grid.Column="0" Text="Color speed" HorizontalAlignment="Right" VerticalAlignment="Center" Height="16" Margin="0,2,0,3" Width="64"/>
                                            <TextBox Grid.Row="0" Grid.Column="2" Text="0" FontSize="11" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Center"/>
                                            <TextBlock Grid.Row="2" Grid.Column="0" Text="Opacity" HorizontalAlignment="Right" VerticalAlignment="Center" Height="16" Margin="0,3,0,2" Width="41"/>
                                            <TextBox Grid.Row="2" Grid.Column="2" Text="1" FontSize="11" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Center"/>
                                            <TextBlock Grid.Row="4" Grid.Column="0" Text="Direct color" HorizontalAlignment="Right" VerticalAlignment="Center" Height="16" Margin="0,2,0,3" Width="61"/>
                                            <TextBox Grid.Row="4" Grid.Column="2" Text="1" FontSize="11" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Center"/>
                                        </Grid>
                                        <CheckBox Grid.Row="8" Content="Solo"/>
                                    </Grid>
                                </GroupBox>
                                
                                <GroupBox Grid.Row="2">
                                    <GroupBox.Header>
                                        <Label>Variation preview</Label>
                                    </GroupBox.Header>
                                    
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto"/>
                                        </Grid.RowDefinitions>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="70"/>
                                            <ColumnDefinition Width="6"/>
                                            <ColumnDefinition Width="*"/>
                                        </Grid.ColumnDefinitions>
                                        
                                        <TextBlock Grid.Row="1" Grid.Column="0" Text="Range"/>
                                        <local:FormattedToolTipSlider Grid.Row="1" Grid.Column="2" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5" SmallChange="1" TickPlacement="BottomRight" IsSnapToTickEnabled="True" AutoToolTipPlacement="BottomRight" AutoToolTipFormat="Range {0}" Minimum="2" Value="2">
                                            <local:FormattedToolTipSlider.RenderTransform>
                                                <TransformGroup>
                                                    <ScaleTransform ScaleY="0.6"/>
                                                    <SkewTransform/>
                                                    <RotateTransform/>
                                                    <TranslateTransform/>
                                                </TransformGroup>
                                            </local:FormattedToolTipSlider.RenderTransform>
                                        </local:FormattedToolTipSlider>
                                        <TextBlock Grid.Row="3" Grid.Column="0" Text="Depth"/>
                                        <local:FormattedToolTipSlider Grid.Row="3" Grid.Column="2" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5" SmallChange="1" TickPlacement="BottomRight" IsSnapToTickEnabled="True" AutoToolTipPlacement="BottomRight" AutoToolTipFormat="Depth {0}" Minimum="1" Value="1" Maximum="5">
                                            <local:FormattedToolTipSlider.RenderTransform>
                                                <TransformGroup>
                                                    <ScaleTransform ScaleY="0.6"/>
                                                    <SkewTransform/>
                                                    <RotateTransform/>
                                                    <TranslateTransform/>
                                                </TransformGroup>
                                            </local:FormattedToolTipSlider.RenderTransform>
                                        </local:FormattedToolTipSlider>
                                        <TextBlock Grid.Row="5" Grid.Column="0" Text="Density"/>
                                        <local:FormattedToolTipSlider Grid.Row="5" Grid.Column="2" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5" SmallChange="1" TickPlacement="BottomRight" IsSnapToTickEnabled="True" AutoToolTipPlacement="BottomRight" AutoToolTipFormat="Density {0}" Minimum="1" Value="1" Maximum="5">
                                            <local:FormattedToolTipSlider.RenderTransform>
                                                <TransformGroup>
                                                    <ScaleTransform ScaleY="0.6"/>
                                                    <SkewTransform/>
                                                    <RotateTransform/>
                                                    <TranslateTransform/>
                                                </TransformGroup>
                                            </local:FormattedToolTipSlider.RenderTransform>
                                        </local:FormattedToolTipSlider>
                                    </Grid>
                                </GroupBox>
                            </Grid>
                        </TabItem>
                    </TabControl>
                </Grid>
            </Grid>
        </Grid>

        <StatusBar Grid.Row="2">
            <StatusBarItem Width="100">
                <TextBlock />
            </StatusBarItem>
            <Separator/>
            <StatusBarItem Width="100">
                <TextBlock />
            </StatusBarItem>
            <Separator/>
            <StatusBarItem Width="Auto">
                <TextBlock />
            </StatusBarItem>
        </StatusBar>
    </Grid>
</Window>
